#include<iostream>
using namespace std;
const int N = 1e5 + 10;
int arr[N];
int n;
int main()
{
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> arr[i];
	}
	int cnt = 0;
	for (int i = 1; i < n; i++) {
		if (i == 1 || arr[i + 1] != arr[i]) {
			arr[++cnt] = arr[i + 1];
		}
	}
	// 2  2 2 2 2  2 10
	for (int i = 1; i <= cnt; i++) {
		cout << arr[i] << " ";
	}
	return 0;
}